#ifndef FUNCTIONS_H
#define FUNCTIONS_H

#include <tins/pdu.h>
#include <tins/ip.h>
#include <vector>
#include <algorithm>
#include <iomanip>

#define NUM_PDUS 51
#define IP_NUM 28
#define MAX_STARS 30


using namespace Tins;


// These hold the unique source and destination
// addresses that are captured during capture phase
extern std::vector<Tins::IP::address_type> srcAddrs; 
extern std::vector<Tins::IP::address_type> dstAddrs;

// pduCount holds a counter for every type of pdu 
// enumerated in the pduNames array
extern unsigned int pduCount[NUM_PDUS]; 

// pduNames is an array of constant strings
// that parallels the PDUType enum defined by
// libtins. These strings are the names of the
// protocols named in the enum
extern const std::string pduNames[];

// Gets user input using cin
// Returns true if the user types "yes"
// Returns true for "yes", "YES", and "y"
// Any other input returns false
bool userY(); 

// updates the statistic variables that keep 
// track of the packet statistics
void updateStats(PDU * tempPDU); 

// Prints the statistics regarding the whole
// session and makes a histogram
void showStats(); 

// Dissects the pdu passed to it and prints 
// information about the whole pdu stack
void pduDissector(PDU * tempPDU, int packetNum);  

#endif
